package com.example.verify;

import java.io.File;

import javax.jws.WebMethod;
import javax.jws.WebService;

import com.example.upload.IUpload;
import com.example.upload.ImplUpload;

/**
 * @author annvcit
 * @full_name Nguyen Van Chuc An
 * @email annvcit@gmail.com
 * @date_created Dec 25, 2014
 *
 */

@WebService
public class ImplVerify implements IVerify{

    @WebMethod
    @Override
    public boolean verify(String fileName, byte[] fileBytes) {
        IUpload uploader = new ImplUpload();
        uploader.upload(fileName, fileBytes);
        String filePath = "/home/annvcit/Desktop/test_webservice/server/upload/" + fileName;
        File file = new File(filePath);
        if (file.length() > 10L) {
            return true;
        }
        return false;
    }

}
